package com.subumbo.audio
{
	import flash.display.Sprite;
	import flash.events.Event;

	public class SubumboHelloWorld extends Sprite
	{
		import com.subumbo.audio.core.AudioEngine;
		import com.subumbo.audio.loader.AudioLoader;
		import com.subumbo.audio.vo.SoundsVO;
		
		private var _audioLoader:AudioLoader;
		
		public function SubumboHelloWorld()
		{
			init()
		}
				
		private function init():void
		{
			
			/**
			 * SoundsVO
			 * 
			 * holds the data
			 * example: /music/redFace.mp3
			 * */
			
			var vo:SoundsVO = new SoundsVO()
			vo.basePath = "music";
			vo.urls.push("redFace");
			
			
			/**
			 * AudioLoaderVO
			 * 
			 * loads multiple Sound objects
			 * 
			 * getSounds:Vector.<Sound>
			 * getBytes:Vector.<ByteArray>  
			 * */
			
			_audioLoader = new AudioLoader(vo);
			_audioLoader.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
			_audioLoader.load();
		}
		
		private function onComplete(e:Event):void
		{
			/**
			 * AudioEngine
			 * 
			 * runs SampleData callBack ---- sampler, mixer, master effect, AudioBuffer
			 * 
			 * toggle:void -->pass int for channel id you want to trigger 
			 * */
			
			AudioEngine.Instance.startup(_audioLoader);
		}
		
	}
}